# %%
from zhipuai import ZhipuAI
client = ZhipuAI(api_key="") # 请填写您自己的APIKey

# %%
t = []
temp = "Apt. no."
t.append(temp)

temp = """
Check here if you, or your
spouse if filing jointly, want $3
to go to this fund. Checking a
box below will not change
your tax or refund.
"""
t.append(temp)

temp = """
If you checked the MFS box, enter the name of your spouse. If you checked the HOH or QSS box, enter the child’s name if the
qualifying person is a child but not your dependent
"""
t.append(temp)

temp = """
If treating a nonresident alien or dual-status alien spouse as a U.S. resident for the entire tax year, check the box and enter
their name (see instructions and attach statement if required):
"""
t.append(temp)

temp = """
At any time during 2024, did you: (a) receive (as a reward, award, or payment for property or services); or (b) sell,
exchange, or otherwise dispose of a digital asset (or a financial interest in a digital asset)? (See instructions.)
"""
t.append(temp)

temp = """
Someone can claim:
You as a dependent
"""
t.append(temp)

temp = """
Child tax credit
Additional child tax credit from Schedule 8812
"""
t.append(temp)

temp = """
Total amount from Form(s) W-2, box 1 (see instructions)
"""
t.append(temp)

temp = """
Tax-exempt interest
"""
t.append(temp)

temp = """
Qualified dividends
"""
t.append(temp)

temp = """
4a IRA distributions b Taxable amount
"""
t.append(temp)

temp = """
If you elect to use the lump-sum election method, check here (see instructions)
"""
t.append(temp)

temp = """
Tax (see instructions). Check if any from Form(s) 8814 4972:
"""
t.append(temp)

temp = """
1040表格里有关于additional standard deduction的信息吗？如果有的话在什么位置？:
"""
t.append(temp)

temp = """
Subtract line 21 from line 18. If zero or less, enter -0-:
"""
t.append(temp)

temp = """
Amount from Schedule 3, line 8
"""
t.append(temp)

temp = """
Federal income tax withheld from:
"""
t.append(temp)

temp = """
Earned income credit (EIC)
"""
t.append(temp)

temp = """
Additional child tax credit from Schedule 8812
"""
t.append(temp)

temp = """
American opportunity credit from Form 8863, line 8
"""
t.append(temp)

temp = """
Reserved for future use
"""
t.append(temp)

temp = """
Amount from Schedule 3, line 15
"""
t.append(temp)

temp = """
Add lines 27, 28, 29, and 31. These are your total other payments and refundable credits
"""
t.append(temp)

temp = """
Add lines 25d, 26, and 32. These are your total payments
"""
t.append(temp)

temp = """
If line 33 is more than line 24, subtract line 24 from line 33. This is the amount you overpaid
"""
t.append(temp)

temp = """
Amount of line 34 you want refunded to you. If Form 8888 is attached, check here
"""
t.append(temp)

temp = """
Routing number
Type:
Checking Savings
Account number
"""
t.append(temp)

temp = """
Amount of line 34 you want applied to your 2025 estimated tax
"""
t.append(temp)

temp = """
Subtract line 33 from line 24. This is the amount you owe.
"""
t.append(temp)

temp = """
Estimated tax penalty (see instructions)
"""
t.append(temp)

temp = """
Do you want to allow another person to discuss this return with the IRS?
"""
t.append(temp)

temp = """
Under penalties of perjury, I declare that I have examined this return and accompanying schedules and statements, and to the best of my knowledge and
belief, they are true, correct, and complete. Declaration of preparer (other than taxpayer) is based on all information of which preparer has any knowledge.
"""
t.append(temp)

temp = """
Paid Preparer Use Only
Preparer’s name
Preparer’s signature
Firm’s name
Firm’s address
"""
t.append(temp)

# %%
prompts = []
instruct = "美国个税申报1040表格中有如下文字，请问是什么意思：\n"
for text in t:
    prompts.append(instruct+text)

# %%

contents = []

for prompt in prompts:
    messages = []
    messages.append({"role": "system", "content": "美国税制专家"})
    messages.append({"role": "user", "content": prompt})

    response = client.chat.completions.create(
        model="GLM-4-Flash-250414",  # 填写需要调用的模型编码
        messages = messages,
    )
    content = response.choices[0].message.content

    contents.append(prompt)
    contents.append(content+"\n")

with open("03_out.txt", "w", encoding="utf-8") as f:
    f.write("\n".join(contents))

# %%
